home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
dev
/
c
/
AMesaRTL.lha
/
Mesa-2.6
/
amiga
/
src
/
api2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-09-19
|
49KB
|
1,763 lines
/* $Id: api2.c,v 1.9 1998/02/05 00:17:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 2.6
* Copyright (C) 1995-1997 Brian Paul
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* api1.c
*
* Version 1.0 27 Jun 1998
* by Jarno van der Linden
* jarno@kcbbs.gen.nz
*
* File created from api2.c ver 1.9 and gl.h ver 1.26 using GenProtos
*
*/
#ifdef PC_HEADER
#include "all.h"
#else
#include <stdio.h>
#include <stdlib.h>
#include "api.h"
#include "bitmap.h"
#include "context.h"
#include "eval.h"
#include "image.h"
#include "macros.h"
#include "matrix.h"
#include "teximage.h"
#include "types.h"
#include "vb.h"
#endif
__asm __saveds void APIENTRY glOrthoA(register __a0 void *vargs)
{
struct glOrthoArgs {
GLdouble left;
GLdouble right;
GLdouble bottom;
GLdouble top;
GLdouble nearval;
GLdouble farval;
} *args;
args = (struct glOrthoArgs *)vargs;
glOrtho(args->left, args->right, args->bottom, args->top, args->nearval, args->farval);
}
__asm __saveds void APIENTRY glOrtho( register __fp0 GLdouble left, register __fp1 GLdouble right,
register __fp2 GLdouble bottom, register __fp3 GLdouble top,
register __fp4 GLdouble nearval, register __fp5 GLdouble farval )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.Ortho)(CC, left, right, bottom, top, nearval, farval);
}
__asm __saveds void APIENTRY glPassThrough( register __fp0 GLfloat token )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PassThrough)(CC, token);
}
__asm __saveds void APIENTRY glPixelMapfv( register __d0 GLenum map, register __d1 GLint mapsize, register __a0 const GLfloat *values )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelMapfv)( CC, map, mapsize, values );
}
__asm __saveds void APIENTRY glPixelMapuiv( register __d0 GLenum map, register __d1 GLint mapsize, register __a0 const GLuint *values )
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLuint i;
GET_CONTEXT;
CHECK_CONTEXT;
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
for (i=0;i<mapsize;i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
for (i=0;i<mapsize;i++) {
fvalues[i] = UINT_TO_FLOAT( values[i] );
}
}
(*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
}
__asm __saveds void APIENTRY glPixelMapusv( register __d0 GLenum map, register __d1 GLint mapsize, register __a0 const GLushort *values )
{
GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
GLuint i;
GET_CONTEXT;
CHECK_CONTEXT;
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) {
for (i=0;i<mapsize;i++) {
fvalues[i] = (GLfloat) values[i];
}
}
else {
for (i=0;i<mapsize;i++) {
fvalues[i] = USHORT_TO_FLOAT( values[i] );
}
}
(*CC->API.PixelMapfv)( CC, map, mapsize, fvalues );
}
__asm __saveds void APIENTRY glPixelStoref( register __d0 GLenum pname, register __fp0 GLfloat param )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelStorei)( CC, pname, (GLint) param );
}
__asm __saveds void APIENTRY glPixelStorei( register __d0 GLenum pname, register __d1 GLint param )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelStorei)( CC, pname, param );
}
__asm __saveds void APIENTRY glPixelTransferf( register __d0 GLenum pname, register __fp0 GLfloat param )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelTransferf)(CC, pname, param);
}
__asm __saveds void APIENTRY glPixelTransferi( register __d0 GLenum pname, register __d1 GLint param )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelTransferf)(CC, pname, (GLfloat) param);
}
__asm __saveds void APIENTRY glPixelZoom( register __fp0 GLfloat xfactor, register __fp1 GLfloat yfactor )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PixelZoom)(CC, xfactor, yfactor);
}
__asm __saveds void APIENTRY glPointSize( register __fp0 GLfloat size )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PointSize)(CC, size);
}
__asm __saveds void APIENTRY glPolygonMode( register __d0 GLenum face, register __d1 GLenum mode )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PolygonMode)(CC, face, mode);
}
__asm __saveds void APIENTRY glPolygonOffset( register __fp0 GLfloat factor, register __fp1 GLfloat units )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PolygonOffset)( CC, factor, units );
}
/* GL_EXT_polygon_offset */
__asm __saveds void APIENTRY glPolygonOffsetEXT( register __fp0 GLfloat factor, register __fp1 GLfloat bias )
{
glPolygonOffset( factor, bias * DEPTH_SCALE );
}
__asm __saveds void APIENTRY glPolygonStipple( register __a0 const GLubyte *mask )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PolygonStipple)(CC, mask);
}
__asm __saveds void APIENTRY glPopAttrib( void )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PopAttrib)(CC);
}
__asm __saveds void APIENTRY glPopClientAttrib( void )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PopClientAttrib)(CC);
}
__asm __saveds void APIENTRY glPopMatrix( void )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PopMatrix)( CC );
}
__asm __saveds void APIENTRY glPopName( void )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PopName)(CC);
}
__asm __saveds void APIENTRY glPrioritizeTextures( register __d0 GLsizei n, register __a0 const GLuint *textures,
register __a1 const GLclampf *priorities )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PrioritizeTextures)(CC, n, textures, priorities);
}
__asm __saveds void APIENTRY glPushMatrix( void )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.PushMatrix)( CC );
}
__asm __saveds void APIENTRY glRasterPos2d( register __fp0 GLdouble x, register __fp1 GLdouble y )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos2f( register __fp0 GLfloat x, register __fp1 GLfloat y )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos2i( register __d0 GLint x, register __d1 GLint y )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos2s( register __d0 GLshort x, register __d1 GLshort y )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, 0.0F, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos3d( register __fp0 GLdouble x, register __fp1 GLdouble y, register __fp2 GLdouble z )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos3f( register __fp0 GLfloat x, register __fp1 GLfloat y, register __fp2 GLfloat z )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos3i( register __d0 GLint x, register __d1 GLint y, register __d2 GLint z )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos3s( register __d0 GLshort x, register __d1 GLshort y, register __d2 GLshort z )
{
GET_CONTEXT;
CHECK_CONTEXT;
(*CC->API.RasterPos4f)( CC, (GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F );
}
__asm __saveds void APIENTRY glRasterPos4d( register __fp0 GLdouble x, register __fp